#ifndef GUARD_H
#define GUARD_H

#include "Enemy.h"

#define NUM_OF_FUNC 8
#define GUARDS_SPEED 1.0f

class Guard : public Enemy
{
public:
	Guard(void);
	void draw(sf::RenderWindow &window);
private:
	//stores the current direction the guard is moving
	//there are 8 directions up down... upleft downright...
	int moveTimeDirection;

	//stores the current time interval which the
	//guard will move in a single direction for
	//in seconds
	float moveTimeInterval;

	//adds up the frame time until it reaches the 
	//random time interval invoked by move()
	float moveTime;

	//holds the function pointers for the direction
	//functions
	void (*direcFuncPtrs[NUM_OF_FUNC])(void *object, void *extraData);
	
	//moves the guard in a 1 of 8 directions for 
	//a random time interval between 2-5 seconds
	void move(sf::RenderWindow &window);

	//these functions move the guard in one of the 8 directions
	friend void guardUp(void *object, void *extraData = 0);
	friend void guardUpRight(void *object, void *extraData = 0);
	friend void guardRight(void *object, void *extraData = 0);
	friend void guardDownRight(void *object, void *extraData = 0);
	friend void guardDown(void *object, void *extraData = 0);
	friend void guardDownLeft(void *object, void *extraData = 0);
	friend void guardLeft(void *object, void *extraData = 0);
	friend void guardUpLeft(void *object, void *extraData = 0);
};

#endif //GUARD_H